<div class="pannel">
    <div class="pannel-head">
        <p>
            <span class="title">企业管理</span>
            <span class="count">(<i style="color: #333;">{{count?.totalNum}}</i>)全部, (<i style="color: #333;">{{count?.ynum}}</i>)已开启, (<i style="color: #f00;">{{count?.nnum}}</i>)已关闭</span>
        </p>
        <button nz-button nzType="primary" [nzSize]="size" [routerLink]='["/qy/add"]'><i nz-icon type="plus"></i>新建</button>
    </div>
    <div class="pannel-body">
        <!-- 搜索 -->
        <div class="pannel-filter">
            <div class="pannel-filter-left">
                <nz-select style="width: 120px" [(ngModel)]="pages.status" (ngModelChange)="changeFilter()">
                    <nz-option nzValue="" nzLabel="全部"></nz-option>
                    <nz-option nzValue="Active" nzLabel="已开启"></nz-option>
                    <nz-option nzValue="InActive" nzLabel="未开启"></nz-option>
                </nz-select>
            </div>
            <div class="pannel-filter-right">
                <nz-input-group [nzSuffix]="suffixIconSearch">
                    <input type="text" nz-input [(ngModel)]="pages.title" placeholder="请输入搜索条件" />
                </nz-input-group>
                <ng-template #suffixIconSearch>
                    <a (click)="changeFilter()"><i nz-icon type="search"></i></a>
                </ng-template>
            </div>
        </div>
        <!-- list -->
        <div>
            <nz-table class="pannel-body-table" #rowSelectionTable [nzScroll]="{ y: '252px' }" [nzData]="list"
                [nzShowPagination]="true" [nzLoading]="tableLoading" [nzFrontPagination]="false"
                [nzPageIndex]="pages.pageNo" [nzTotal]="pages.total" [nzPageSize]="pages.pageSize"
                [nzPageSizeOptions]="[10,20,30,40,50]" [nzShowQuickJumper]="true" [nzShowSizeChanger]="true">
                <thead>
                    <tr>
                        <th  nzWidth="1%" nzShowCheckbox [(nzChecked)]="isAllDisplayDataChecked" [nzIndeterminate]="isIndeterminate"
                            (nzCheckedChange)="checkAll($event)"></th>
                        <th nzWidth="5%">账号</th>
                        <th nzWidth="10%">企业名称</th>
                        <th nzWidth="10%">机构代码</th>
                        <th nzWidth="10%">联系人</th>
                        <th nzWidth="10%">联系人电话</th>
                        <th nzWidth="10%">联系邮箱</th>
                        <th nzWidth="10%">地址</th>
                        <th nzWidth="9%">状态</th>
                        <th nzWidth="10%">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr *ngFor="let data of list" (click)="selectThis(data)"
                        [ngClass]="{active:data?.id === selectRow?.id}">
                        <td  nzWidth="1%" nzShowCheckbox [(nzChecked)]="mapOfCheckedId[data.id]" [nzDisabled]="data.disabled"
                            (nzCheckedChange)="refreshStatus()"></td>
                        <td nzWidth="5%">{{ data?.code }}</td>
                        <td nzWidth="10%">{{ data?.name }}</td>
                        <td nzWidth="10%">{{ data?.code }}</td>
                        <td nzWidth="10%">{{ data?.securityDirector }}</td>
                        <td nzWidth="10%">{{ data?.contactTel }}</td>
                        <td nzWidth="10%">{{data?.contactEmail}}</td>
                        <td nzWidth="10%">{{data?.cityName}}{{data?.areaName}}{{ data?.address }}</td>
                        <td nzWidth="9%">
                            <nz-tag *ngIf="data?.active === 'Active'" [nzColor]="'#87d068'">已开启</nz-tag>
                            <nz-tag *ngIf="data?.active === 'InActive'" [nzColor]="'#f50'">已关闭</nz-tag>
                        </td>
                        <td nzWidth="10%">
                            <a (click)="updateUser(data)" class="logo-edit" routerLink="/qy/edit"
                                [queryParams]="{ id : data?.id}"><i nz-icon nzType="edit" nzTheme="fill"></i>
                            </a>
                            <a (click)="updateUser(data)" class="logo-del" style="margin-right: 8px;" routerLink="/qy/edit"
                                [queryParams]="{ id : data?.id}"><i nz-icon nzType="delete" nzTheme="fill"></i>
                            </a>
                            <a *ngIf="data?.status === 'Normal'" class="logo-block" nz-popconfirm nzTitle="企业被禁用后，将无法对该企业进行监测！" nzOkText="确定" nzCancelText="取消"
                                (nzOnConfirm)="confirm(data)" (nzOnCancel)="cancel()">
                                <font>禁用</font>
                            </a>
                        </td>
                    </tr>
                </tbody>
            </nz-table>
            <ng-template #totalTemplate let-total> 共{{ pages?.pages }}条</ng-template>
        </div>
    </div>
</div>